package monitor

import (
	"fmt"
	"os/exec"
)

//Cmd 执行系统命令
func Cmd(cmd string, shell bool) []byte {
	if shell {
		out, err := exec.Command("bash", "-c", cmd).Output()
		if err != nil {
			fmt.Println("some error found", err)
		}
		return out
	}
	out, err := exec.Command(cmd).Output()
	if err != nil {
		fmt.Println("some error found", err)
	}
	return out

}
